package com.bmft.task01.dao;

import java.util.Map;

/**
 * @author Jarvan
 * @version 1.0
 * @create 2020/9/26 10:48
 */
public interface AnimalDao {
    /**
     * Insert a new Animal
     *
     * @param animalName animal name
     * @param animal     animal
     * @return whether insert success.
     */
    boolean insertAnimal(String animalName, Map<String, Object> animal);

    /**
     * Delete a Animal
     *
     * @param animalName
     * @return whether delete success.
     */
    boolean deleteAnimal(String animalName);

    /**
     * Modify a Animal name
     *
     * @param oldName old name
     * @param newName new name
     * @return whether modify success.
     */
    boolean modifyAnimalName(String oldName, String newName);

    /**
     * Get all the animal.
     *
     * @return all the animal
     */
    Map<String, Map<String, Object>> queryAllAnimalList();

    /**
     * Insert Animal characteristic .
     *
     * @param animalName         animal name
     * @param characteristicName animal characteristic name.
     * @param characteristic     characteristic
     * @return whether insert success or not.
     */
    boolean insertCharacteristic(String animalName, String characteristicName, Object characteristic);

    /**
     * Delete characteristic of  the animal.
     *
     * @param animalName         animal name.
     * @param characteristicName characteristic name.
     * @return whether delete success or not.
     */
    boolean deleteCharacteristic(String animalName, String characteristicName);

    /**
     * Update characteristic fo the animal.
     *
     * @param animalName         animal name
     * @param characteristicName characteristic name
     * @param newCharacteristic  new characteristic
     * @return where update success or not.
     */
    boolean updateCharacteristic(String animalName, String characteristicName, Object newCharacteristic);

    /**
     * query all the characteristics of the animal.
     *
     * @param animalName animal name.
     * @return animal include it's characteristics.
     */
    Map<String, Object> queryCharacteristics(String animalName);

    /**
     * Whether animal exist.
     * @param animalName animal name.
     * @return Whether animal exist.
     */
    boolean existAnimal(String animalName);

    /**
     * Update animal name.
     * @param animalOldName animal old name.
     * @param animalNewName animal new name.
     * @return true if name update success.
     */
    boolean updateAnimalName(String animalOldName, String animalNewName);
}
